angular.module('app-util-filter', [])

.filter 'integer', ->
    (number) ->
        Math.floor number
#获取整数部分

.filter 'dateFix', () ->
    (val) ->
        if val >= 1 and val <= 9 then '0' + val else val

.filter 'decimal', ->
    (number) ->
# 获取小数部分，保留俩位小数数字
        decimal = (number - Math.floor(number)).toPrecision(3)
        decimal.substr(2)
